import store from '@/store'
import request from '@/utils/request'
import qs from 'qs'

interface User {
  phone: string | number
  password: string
}

export const login = (datafrm: User): any => {
  return request({
    method: 'POST',
    url: '/front/user/login',
    data: qs.stringify(datafrm),
    headers: { 'content-type': 'application/x-www-form-urlencoded' }
  })
}

export const getUserInfo = (): any => {
  return request({
    method: 'GET',
    url: '/front/user/getInfo'
  })
}

export const logout = (): any => {
  return request({
    method: 'POST',
    url: '/front/user/logout'
  })
}
